﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Com.Rivyer.Web.issue
{
    public partial class issuesoverview : System.Web.UI.Page
    {
        private readonly BLL.userauthorityBll authoritybll = new BLL.userauthorityBll();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (authoritybll.GetModel(Session["username"].ToString()).isadmin == 1)
            {
                issuesstatusgrid.Columns[0].Visible = true;
            }
            else
            {
                issuesstatusgrid.Columns[0].Visible = false;
            }
        }

        protected void ASPxButton1_Click(object sender, EventArgs e)
        {
            new BLL.useroperatelogBll().AddLog(Session["username"].ToString(), "下载", "问题汇总表");
            ASPxGridViewExporter1.WriteXlsxToResponse("问题汇总表");
        }

        protected void issuesstatusgrid_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e)
        {
            e.NewValues["modifydate"] = DateTime.Now;
        }

        protected void issuesstatusgrid_RowUpdated(object sender, DevExpress.Web.Data.ASPxDataUpdatedEventArgs e)
        {
            new BLL.useroperatelogBll().AddLog(Session["username"].ToString(), "回复", string.Format("一条记录"));
        }
    }
}